<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <p:menubar model="#{staffChangeInitialPasswordManagedBean.staffMenuModel}"/>
    </ui:define>
    <ui:define name="content">
        <h:form>
            <p:panel id="panel" header="Add New Stakeholder">
                <f:metadata>
                    <f:viewParam name ="activate" value ="#{tCubeManagerBean.selectedStakeholder.activate}" />
                </f:metadata>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>
                <p:messages />
                <h:panelGrid columns="3" cellpadding="10">
                    <h:outputLabel for="username" style="font-weight: bold" value="Stakeholder username: " />
                    <h:outputText id="username" value="#{tCubeManagerBean.selectedStakeholder.username}">
                    </h:outputText>
                    <p:message for="username" />

                    <h:outputLabel for="corpName" style="font-weight: bold" value="Corporate name: " />
                    <h:outputText id="corpName" value="#{tCubeManagerBean.selectedStakeholder.corpName}">
                    </h:outputText>
                    <p:message for="corpName" />

                    <h:outputLabel for="bizRegNumber" style="font-weight: bold" value="Business Registration Number: " />
                    <h:outputText id="bizRegNumber" value="#{tCubeManagerBean.selectedStakeholder.bizRegNumber}">                   
                    </h:outputText>
                    <p:message for="bizRegNumber" />

                    <h:outputLabel for="houseNumber" style="font-weight: bold" value="House Number: " />
                    <h:outputText id="houseNumber" value="#{tCubeManagerBean.selectedStakeholder.address.houseNumber}">
                    </h:outputText>
                    <p:message for="buildingName" />

                    <h:outputLabel for="buildingName" style="font-weight: bold" value="Building Name: " />
                    <h:outputText id="buildingName" value="#{tCubeManagerBean.selectedStakeholder.address.buildingName}">
                    </h:outputText>
                    <p:message for="buildingName" />

                    <h:outputLabel for="streetName" style="font-weight: bold" value="Street Name: " />
                    <h:outputText id="streetName" value="#{tCubeManagerBean.selectedStakeholder.address.streetName}">
                    </h:outputText>
                    <p:message for="streetName" />

                    <h:outputLabel for="postalCode" style="font-weight: bold" value="Postal Code: " />
                    <h:outputText id="postalCode" value="#{tCubeManagerBean.selectedStakeholder.address.postalCode}">
                    </h:outputText>
                    <p:message for="postalCode" />

                    <h:outputLabel for="phoneNumber" style="font-weight: bold" value="Phone Number: " />
                    <h:outputText id="phoneNumber" value="#{tCubeManagerBean.selectedStakeholder.corpContactNumber}">                                              
                    </h:outputText>
                    <p:message for="phoneNumber" />

                    <h:outputLabel for="email" style="font-weight: bold" value="Email: " />
                    <h:outputText id="email" value="#{tCubeManagerBean.selectedStakeholder.corpEmail}">
                    </h:outputText>
                    <p:message for="email" />

                    <h:outputLabel for="fax" style="font-weight: bold" value="Fax: " />
                    <h:outputText id="fax" value="#{tCubeManagerBean.selectedStakeholder.corpFaxNumber}">
                    </h:outputText>
                    <p:message for="fax" />

                    <h:outputLabel for="activate" style="font-weight: bold" value="Activation status: " />
                    <h:outputText value ="#{tCubeManagerBean.selectedStakeholder.activate}" />
                    <p:message for="fax" />

                    <p:button value="Activate" disabled="#{tCubeManagerBean.selectedStakeholder.activate}" outcome="TCubeEditStakeholderInfo">
                        <f:param name="activate" value="true" />
                    </p:button>

                    <p:button value="Deactivate" disabled="#{!tCubeManagerBean.selectedStakeholder.activate}" outcome="TCubeEditStakeholderInfo">
                        <f:param name="activate" value="false" />
                    </p:button>

                </h:panelGrid>
                <p:commandButton id="btn" value="Save Stakeholder Info" update="panel" actionListener="#{tCubeManagerBean.editStakeholderInfo}" ajax="true" />
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>
